package com.ufcg.lvc.client.prototipacao;

import java.util.Date;

/**
 * 
 * @author Larissa Costa
 *
 */
public class MyDate extends Date{

	public String getHora(){
		return toString().split(" ")[3];
	}
	
	public String getData(){
		return toString().split(" ")[2] + "."+getMes(toString().split(" ")[1])+"."+toString().split(" ")[-1];
	}
	
	private String getMes(String mes){
		String[] meses = {"","Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
		for (int i = 0; i < meses.length; i++) {
			if (mes.equals(meses[i])) {
				if (i < 10){
					return "0"+meses[i];
				}else{
					return meses[i];
				}
			}
		}
		return "01";
	}
	
	public String getDataHora(){
		return getData() + " - " + getHora();
	}
}
